import request from '@/utils/request'
import { Encrypt } from '@/utils/cryptoJS'

/**
 * 风险单元相关接口
 */
export function useRiskUnitApi() {
    return {
        // 查询风险单元列表
        findUnit: (data) => {
            const value_Encrypt = Encrypt(JSON.stringify(data))
            return request({
                url: '/hcp-dp/riskUnit/findUnit',
                method: 'post',
                data: { value: value_Encrypt }
            })
        },

        // 查询风险单元详情
        findUnitDetails: (data) => {
            const value_Encrypt = Encrypt(JSON.stringify(data))
            return request({
                url: '/hcp-dp/riskUnit/findUnitDetails',
                method: 'post',
                data: { value: value_Encrypt }
            })
        },

        // 新增风险单元
        addUnit: (data) => {
            const value_Encrypt = Encrypt(JSON.stringify(data))
            return request({
                url: '/hcp-dp/riskUnit/addUnit',
                method: 'post',
                data: { value: value_Encrypt }
            })
        },

        // 修改风险单元
        updateUnit: (data) => {
            const value_Encrypt = Encrypt(JSON.stringify(data))
            return request({
                url: '/hcp-dp/riskUnit/updateUnit',
                method: 'post',
                data: { value: value_Encrypt }
            })
        },

        // 生成包保数据
        addUnitBBInfo: (data) => {
            const value_Encrypt = Encrypt(JSON.stringify(data))
            return request({
                url: '/hcp-dp/riskUnit/addUnitBBInfo',
                method: 'post',
                data: { value: value_Encrypt }
            })
        }
    }
} 